library(DMC21cent)SEXsl_summary(adsl,
vars = "SEX",
kinds = "bar_binom",
titles = "Female Subjects (%)",
trt = "TRT01P")sl_summary(adsl,
vars = list("SEX" = "M"), # `list()` only works for `bar_binom` kind
kinds = "bar_binom",
titles = "Male Subjects (%)",
trt = "TRT01P")sl_summary(adsl,
vars = c(list("SEX" = "M"), "SEX"),
kinds = c("bar_binom"),
trt = "TRT01P",
show_plots = TRUE,
titles = c("Male Subjects (%)", "Female Subjects (%)"),
ncol = 1)
# or you can save the output of sl_summary() in an object.RACEsl_summary(adsl,
vars = "RACE",
kinds = "bar_stack", # `bar_stack` visualization will be applied for both `SEX` and `RACE`
titles = "RACE (%)", # Put `NA` when you don't need to have a main title for your plot
trt = "TRT01P")sl_summary(adsl,
vars = c("RACE", "SEX"),
kinds = c("bar_stack"), # `bar_stack` visualization will be applied for both `SEX` and `RACE`
titles = c("RACE (%)", NA), # Put `NA` when you don't need to have a main title for your plot
trt = "TRT01P")AGEsl_summary(adsl,
vars = "AGEGR1",
relevel_vec = list(adsl %>% pull(AGEGR1) %>% levels() %>% rev()),
kinds = "bar_stack", # `bar_stack` visualization will be applied for both `SEX` and `RACE`
titles = "AGE Group 1 (%)", # Put `NA` when you don't need to have a main title for your plot
trt = "TRT01P")sl_summary(adsl,
vars = "AGE",
kinds = "box",
titles = "AGE (years)",
trt = "TRT01A",
breaks_vec = list(c(60, 70, 80, 90)),
show_plots = TRUE)plots <- sl_summary(adsl,
vars = c("SEX", "AGE"),
kinds = c("bar_stack", "box"),
titles = c("Female Subjects (%)", "AGE (years)"),
trt = "TRT01A",
breaks_vec = list(NULL, c(60, 70, 80, 90)),
show_plots = FALSE)
patchwork::wrap_plots(plots, ncol = 1)
# In case you want to save your plot:
# ggplot2::ggsave(
# plots[[1]],
# filename = here::here("Your_File", "Figure01_sex_f.png"),
# width = 4,
# height = 2
# )ae_summary(adae = adae,
adsl = adsl,
kind = "forest",
pval_cutoff = 0.6,
title = "Adverse events (Preferred Terms), hazard ratios",
subtitle = "Xanomeline High Dose vs. Placebo, Safety analysis set",
caption = "Hazard ratio calculated from a Cox regression model."
)ae_summary(adae = adae,
adsl = adsl,
kind = "rate",
reord_type_rateplot = "diff",
title = "Adverse events (Preferred Terms), incidence rates",
subtitle = "Xanomeline High Dose vs. Placebo, Safety analysis set",
caption = ""
)ae_summary(adae = adae,
adsl = adsl,
kind = "rate",
reord_type_rateplot = "trt",
title = "Adverse events (Preferred Terms), incidence rates",
subtitle = "Xanomeline High Dose vs. Placebo, Safety analysis set",
caption = ""
)ae_summary(adae = adae,
adsl = adsl,
kind = "rate",
reord_type_rateplot = "placebo",
title = "Adverse events (Preferred Terms), incidence rates",
subtitle = "Xanomeline High Dose vs. Placebo, Safety analysis set",
caption = ""
)ae_summary(adae = adae,
adsl = adsl,
kind = "swimmer",
title = "Adverse event profiles",
subtitle = "Patients with at least one treatment-emergent serious or severe AE, Xanomeline High Dose, Safety analysis set",
caption = "The red and bold fonts show severe and serious events respectively. \n The grey box indicates individual patient Xanomeline exposure."
)ae_summary(adae = adae,
adsl = adsl,
kind = "volcano_pval",
pval_cutoff = 1,
adjpval_cutoff = 0.9,
title = "Comparison of adverse events (preferred terms) by treatment",
subtitle = "Xanomeline High Dose vs. Placebo, Safety analysis set",
caption = "P-value is from a Cox regression model."
)ae_summary(adae = adae,
adsl = adsl,
kind = "volcano_adjpval",
pval_cutoff = 1,
adjpval_cutoff = 0.9,
title = "Comparison of adverse events (preferred terms) by treatment",
subtitle = "Xanomeline High Dose vs. Placebo, Safety analysis set",
caption = "P-value is from a Cox regression model, adjusted for multiple comparisons (based on false discovery rate)."
)lab_summary(adlb = adlbc,
kind = "abnormal",
param_filter = "Cholesterol (mmol/L)",
selected_visit = c("Baseline", "Week 2", "Week 4", "Week 6", "Week 8", "End of Treatment"),
title = NULL # an auto generated title
)lab_summary(adlb = adlbc,
kind = "box",
param_filter = "Cholesterol (mmol/L)",
selected_visit = c("Baseline", "Week 2", "Week 4", "Week 6", "Week 8", "End of Treatment"),
title = NULL # an auto generated title
)lab_summary(adlb = adlbhy,
kind = "shift",
param_filter = "Alanine Aminotransferase (U/L)",
title = NULL, # automatically generated title,
shift_breaks_vec = NULL # automatically generated 25X breaks, and 50X labels
)lab_spaghetti(adlb = adlbc,
param_filter = "Bilirubin (umol/L)",
selected_visit = c("Baseline", "Week 2", "Week 4", "Week 6", "Week 8", "End of Treatment"))lab_spaghetti(adlb = adlbc,
param_filter = "Creatine Kinase (U/L)",
axis_tick_size = 8,
x_axis_wrap = 6,
selected_visit = c("Baseline", "Week 2", "Week 4", "Week 6", "Week 8", "End of Treatment"))patient_profile(data = adsl,
usubjid = "02-718-1371",
kind = 'summary')| USUBJID | SEX | RACE | AGE | ARM | SITEID | First Exposure to TRT | Last Exposure to TRT |
|---|---|---|---|---|---|---|---|
| 02-718-1371 | F | WHITE | 69 | Xanomeline High Dose | 718 | 2013-04-26 | 2013-08-01 |
patient_profile(data = adlbc,
usubjid = "02-718-1371",
kind = 'lab',
filter_safety_flag_lab = "Y",
ncol_lab = 1,
transform_lab = 'log',
params_lab = c("Alanine Aminotransferase (U/L)",
"Aspartate Aminotransferase (U/L)",
"Bilirubin (umol/L)"),
selected_visit = c("Baseline", "Week 2", "Week 4", "Week 6", "Week 8", "End of Treatment"))patient_profile(data = adae,
usubjid = "02-718-1371",
kind = 'ae',
str_wrap_ae_cm = 25,
height_ae = 250)patient_profile(data = adcm,
usubjid = "02-718-1371",
str_wrap_ae_cm = 25,
kind = 'cm')| USUBJID | SEX | RACE | AGE | ARM | SITEID | First Exposure to TRT | Last Exposure to TRT |
|---|---|---|---|---|---|---|---|
| 02-718-1371 | F | WHITE | 69 | Xanomeline High Dose | 718 | 2013-04-26 | 2013-08-01 |